# coding=utf-8
'''
Created on 2013-12-20

@author: sunxiang
'''
from mongoengine import *
    
class Profile(EmbeddedDocument):
    realname = StringField(max_length=16)
    tags = ListField(StringField(max_length=16))
    regtime = ComplexDateTimeField()
    lastlogtime = ComplexDateTimeField()
    avatar = StringField()
    
class Sites(EmbeddedDocument):
    github = URLField()
    weibo = URLField()
    douban = URLField()

class User(Document):
    uuid = UUIDField()
    mid = LongField()
    username = StringField(max_length=16)
    password = StringField()
    nickname = StringField(max_length=16)
    email = EmailField()
    profile = EmbeddedDocumentField(Profile)
    sites = EmbeddedDocumentField(Sites)
